feat: add list-payroll-calendars and list-earnings-rates tools#169
Open
elliotchisholm wants to merge 4 commits into
Open
feat: add list-payroll-calendars and list-earnings-rates tools#169elliotchisholm wants to merge 4 commits into
elliotchisholm wants to merge 4 commits into
Conversation
c734fc8 to
2be4430
Compare
- Upgrade xero-node from ^13.3.0 to ^15.0.1 - Add PayrollAuV2Api client to xero-client.ts with lazy init and token sync - Add payroll-au-v2-types.ts shim for AU v2 Timesheet/TimesheetLine types - Fix SDK breaking change: hoursAccruedAnnually renamed to unitsAccruedAnnually - Add vitest for test infrastructure The PayrollAuV2Api is a separate class not wired into XeroClient, so it requires manual instantiation and access token management. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Replace all AU-specific workaround code with v2 API calls via PayrollAuV2Api. This aligns AU with NZ/UK — all three regions now use the same v2 endpoint patterns. Changes per handler: - approve: remove GET-then-PUT status workaround, call approveTimesheet - revert: remove GET-then-PUT status workaround, call revertTimesheet - delete: remove AU error block, call deleteTimesheet (previously unsupported) - create: remove array wrapping, use single-object createTimesheet - add-line: remove GET-append-PUT workaround, call createTimesheetLine - update-line: remove earningsRateID matching, call updateTimesheetLine by ID - get: call getTimesheet via v2 client - list: remove AU-only params (where/order/ifModifiedSince), use v2 params Breaking input changes for AU callers: - numberOfUnits is now a single number (not array) with a date per line - payrollCalendarID is now required on create - timesheetLineID is now required on update-line Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
New handler, tool, and tests for DELETE /timesheets/{id}/lines/{lineId}.
Previously this operation had no MCP tool. Supports AU (via
PayrollAuV2Api), NZ, and UK.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
New tools: - list-payroll-calendars: shows pay calendar names, types, and upcoming payment dates. AU uses payrollAUApi.getPayrollCalendars (v1), NZ/UK use getPayRunCalendars. - list-earnings-rates: shows earnings rate IDs, names, and types needed for creating timesheet lines. AU uses payrollAUApi.getPayItems (v1) and extracts the earningsRates array, NZ/UK use getEarningsRates. Both tools support AU, NZ, and UK with region auto-detection. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2be4430 to
3cc877c
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds two new MCP tools:
list-payroll-calendars— lists payroll calendars for an organisationlist-earnings-rates— lists earnings rates for an organisationWhy
The AU v2
create-timesheettool requires apayrollCalendarID, andadd-timesheet-linerequires anearningsRateID. Without these listing tools, callers had no way to look up the required IDs via MCP.Note for reviewer
This is part of a stacked series — please merge in order (#165–#168 first). Once those merge into main, this PR's diff will show only these changes.
Part 5 of 8 — AU timesheet v2 migration stack.